<%@ Page Language="C#" MasterPageFile="~/Shared/Default.master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="WCSFContrib.ECommerceCatalog.DevelopmentWebsite.Register" Title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit.WCSFExtensions" Namespace="AjaxControlToolkit.WCSFExtensions" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="DefaultContent" runat="server">
    <div id="loginregister">
        <h2>Sign up for a new account</h2>
          <fieldset>
          <legend>Create account</legend>
            <asp:CreateUserWizard ID="CreateUserWizard1" Runat="server" ConfirmPasswordLabelText="Confirm Password" EmailLabelText="Email" PasswordLabelText="Password" UserNameLabelText="User Name" QuestionLabelText="Security Question" AnswerLabelText="Security Answer" CreateUserButtonText="Create Account" OnContinueButtonClick="CreateUserWizard1_ContinueButtonClick" EmailRegularExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
                <WizardSteps>
                    <asp:CreateUserWizardStep ID="CreateUserWizardStep1" Runat="server" Title="Please provide the following information">
                        <ContentTemplate>
                            <table border="0">
                                <tr>
                                    <td align="left"colspan="2">
                                        Please provide the following information
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name</asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="UserName" runat="server" />
                                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                                                    ControlToValidate="UserName"
                                                                    ErrorMessage="User name is required." 
                                                                    Display="None" 
                                                                    ValidationGroup="CreateUserWizard1" />
                                        <ajax:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2"
                                                            TargetControlID="UserNameRequired"
                                                            HighlightCssClass="validatorCalloutHighlight" />
                                        <asp:CustomValidator ID="UserNameCustomValidator" runat="server" 
                                                             ErrorMessage="The user name already exists." 
                                                             ControlToValidate="UserName" 
                                                             OnServerValidate="UserNameValidator_ServerValidate" 
                                                             Display="None" />
                                        <cc1:ServerSideValidationExtender ID="UserNameServerSideValidationExtender" 
                                                                          runat="server" 
                                                                          TargetControlID="UserNameCustomValidator" />
                                        <ajax:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1"
                                                            TargetControlID="UserNameCustomValidator"
                                                            HighlightCssClass="validatorCalloutHighlight" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password</asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                                                                    ControlToValidate="Password"
                                                                    ErrorMessage="Password is required." 
                                                                    Display="None"
                                                                    ValidationGroup="CreateUserWizard1" />
                                        <ajax:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3"
                                                            TargetControlID="PasswordRequired"
                                                            HighlightCssClass="validatorCalloutHighlight" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password</asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" 
                                                                    ControlToValidate="ConfirmPassword"
                                                                    ErrorMessage="Confirm Password is required." 
                                                                    Display="None"
                                                                    ValidationGroup="CreateUserWizard1" />
                                        <ajax:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender4"
                                                            TargetControlID="ConfirmPasswordRequired"
                                                            HighlightCssClass="validatorCalloutHighlight" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">Email</asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="EmailRequired" runat="server" 
                                                                    ControlToValidate="Email"
                                                                    ErrorMessage="E-mail is required." 
                                                                    Display="None"
                                                                    ValidationGroup="CreateUserWizard1" />
                                        <ajax:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender5"
                                                            TargetControlID="EmailRequired"
                                                            HighlightCssClass="validatorCalloutHighlight" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="2">
                                        <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                                            ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                                            ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="2">
                                        <asp:RegularExpressionValidator ID="EmailRegExp" runat="server" ControlToValidate="Email"
                                            Display="Dynamic" ErrorMessage="Please enter a different e-mail." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                            ValidationGroup="CreateUserWizard1"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="2" style="color: red">
                                        <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:CreateUserWizardStep>
                    <asp:CompleteWizardStep ID="CompleteWizardStep1" Runat="server" Title="Thank you for joining the E-Commerce Catalog!">
                    </asp:CompleteWizardStep>
                </WizardSteps>
            </asp:CreateUserWizard>
          </fieldset>
      </div>
</asp:Content>
